package com.tao.auto.batchtao.home.account;

import com.tao.auto.batchtao.base.PhoneMessageCode;
import com.tao.auto.batchtao.base.accout.BaseAccount;
import com.tao.auto.batchtao.database.entity.MgtUserInfo;
import org.springframework.stereotype.Component;

/**
 * @author GLNC-taowenchen
 */
@Component
public class HomeLoginAccountImpl implements BaseAccount<HomeAccount> {


    @Override
    public HomeAccount account() {
        MgtUserInfo phone = null;
        try {
            phone = HomeAccountQueue.queue.take();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        HomeAccount homeAccount = new HomeAccount();
        homeAccount.setAccount(phone.getUsername());
        homeAccount.setNickname(phone.getUsername());
        homeAccount.setPassword(phone.getPassword());
        homeAccount.setSpread(phone.getFatherInvitationCode()+"");
        return homeAccount;
    }
}
